<?php

class ChemSpell
{
    var $soapHost = "http://chemspell.nlm.nih.gov/axis/SpellAid.jws?wsdl";
    var $mError = '';

    public function ChemSpellLookup($query, $src="All databases")
    {
        $soapClient = new SoapClient($this->soapHost);

        try
        {
            $chem_response = $soapClient->getSugList($query, $src);
        }
        catch(SoapFault $exception)
        {
            echo $exception->getMessage();
        }
        
        return $chem_response;

    }

    function GetError()
    {
	return $this->mError;
    }
}
?>
